package br.com.db;

import java.io.File;
import java.io.IOException;

import org.apache.sanselan.ImageReadException;
import org.apache.sanselan.ImageWriteException;

public class IptcCleanup {

	/**
	 * @param args
	 * @throws IOException
	 * @throws ImageReadException
	 * @throws ImageWriteException
	 */
	public static void main(String[] args) throws IOException, ImageWriteException {

		File folder = new File("C:\\georeferenced_images");
		File[] listOfFiles = folder.listFiles();

		for (File file : listOfFiles) {

			
			try {
				PhotoIPTC photoIPTC = new PhotoIPTC(file);
				photoIPTC.clearIPTCKeyWords();
			} catch (ImageReadException e) {
				//System.out.println(file.getName() + " - Not a Valid JPEG File: doesn't begin with 0xffd8");
				e.printStackTrace();
			}

		}
	}
}
